package com.xingdata.jjxc.utils;

import java.util.ArrayList;
import java.util.List;

import com.alibaba.fastjson.JSON;
import com.xingdata.jjxc.enty.CarhudEntity;
import com.xingdata.jjxc.enty.ComAddressEntity;

/**
 * 公共类，记录不同界面的标题title文字。每个界面用相同表头layout，<include layout="@layout/title_grey" />
 * 很方便后面的查询。话说这个类的名字，取的真心很随便。
 * 
 * @author ysc
 * 
 */
public class JUtils {
	
	//发现
	/**
	 * 评论
	 */
	public static final String COMMENTS = "评论";

	// 添加车辆
	public static final String TITILE_ADDLOVECAR = "添加车辆";
	/**
	 * HUD简介
	 */
	public static final String TITILE_HUDSUMMARY = "HUD简介";

	// 填写备注名称
	public static final String TITILE_COMADDRESSSET = "填写备注名称";
	// 车辆信息
	public static final String TITILE_CARINFOMATION = "车辆信息";
	// 编辑车辆
	public static final String TITILE_EDITLOVECAR = "编辑车辆";
	// 高德导航
	public static final String TITILE_DAOHANG = "高德导航";
	// 我的
	/**
	 * HUD设置
	 */
	public static final String TITILE_PARASETA = "HUD设置";

	/**
	 * 我的收藏
	 */
	public static final String TITILE_COMMADD = "常用地点";
	/**
	 * 关于驾驾
	 */
	public static final String TITILE_JJXC = "关于驾驾";
	/**
	 * 意见反馈
	 */
	public static final String TITILE_FEEDBACK = "HUD反馈";
	/**
	 * HUD升级
	 */
	public static final String HUD_UPGRADE = "HUD升级";

	/**
	 * 字体路径
	 */
	public static final String TypefacePath = "fonts/PingFang-SC-Regular.ttf";

	/**
	 * 登录hud用户信息
	 * 
	 * @param carHudJson
	 * @return
	 */
	public static List<CarhudEntity> getcarHudList(String carHudJson) {

		if (carHudJson.equals("[]")) {
			return new ArrayList<CarhudEntity>();
		}
		List<CarhudEntity> carHudList = JSON.parseArray(carHudJson, CarhudEntity.class);

		return carHudList;

	}

	// 用户常用地址
	public static List<ComAddressEntity> getSiteList(String siteJson) {
		if (siteJson.equals("[]")) {
			return new ArrayList<ComAddressEntity>();
		}
		List<ComAddressEntity> siteList = JSON.parseArray(siteJson, ComAddressEntity.class);
		return siteList;
	}

}
